package at.ac.tuwien.isis.infret.ue2.tests;

import static org.junit.Assert.*;

import java.io.File;
import java.util.Iterator;
import java.util.Vector;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import at.ac.tuwien.isis.infret.helper.DocumentContainer;
import at.ac.tuwien.isis.infret.ue2.ArffParser;

public class ArffParserTest {
	
	ArffParser test;
	@Before
	public void setUp() throws Exception {
		test = new ArffParser(
				"res"+File.separatorChar+
				"tests"+File.separatorChar+
				"test.arff");
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testGetDocumentContainer() {
		Vector<DocumentContainer> dc = test.getDocumentContainer();
		Iterator<DocumentContainer> iter = dc.iterator();
		int i = 1;
		while(iter.hasNext()){
			DocumentContainer doc = iter.next();
			assertEquals("doc"+i, doc.getDocumentname());
			assertEquals("Iris-setosa", doc.getClassname());
			i++;
		}
	}

}
